using System;
using System.Globalization;

namespace jSLCore.Client.Presentation.jBinding.BaseConverters
{
    public class jTextIfEmptyStringConverter : jChainConverter
    {

        public string Text { get; set; }

        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return Text;
            if (string.IsNullOrEmpty(value.ToString()))
                return Text;
            return value;
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}